import request from '@/utils/request'

// 查询行业列表
export function listIndustry(query) {
  return request({
    url: '/pms/industry/list',
    method: 'get',
    params: query
  })
}

// 查询行业列表（排除节点）
export function listIndustryExcludeChild(industryId) {
  return request({
    url: '/pms/industry/list/exclude/' + industryId,
    method: 'get'
  })
}

// 查询行业详细
export function getIndustry(industryId) {
  return request({
    url: '/pms/industry/' + industryId,
    method: 'get'
  })
}


// 查询行业下拉树结构
export function treeselect() {
  return request({
    url: '/pms/industry/treeselect',
    method: 'get'
  })
}

// 根据公司ID查询行业下拉树结构
export function companyIndustryTreeselect(companyId) {
  return request({
    url: '/pms/industry/companyIndustryTreeselect/' + companyId,
    method: 'get'
  })
}

// 根据产品ID查询行业下拉树结构
export function productIndustryTreeselect(productId) {
  return request({
    url: '/pms/industry/productIndustryTreeselect/' + productId,
    method: 'get'
  })
}

// 新增行业
export function addIndustry(data) {
  return request({
    url: '/pms/industry',
    method: 'post',
    data: data
  })
}

// 修改行业
export function updateIndustry(data) {
  return request({
    url: '/pms/industry',
    method: 'put',
    data: data
  })
}

// 删除行业
export function delIndustry(industryId) {
  return request({
    url: '/pms/industry/' + industryId,
    method: 'delete'
  })
}